{extend name="default/base/base_seller" /}
{block name="seller_main"}
<div class="alert alert-block mt10">
    <h4>{$Think.lang.action_prompt}：</h4>
    <ul>
        <li>1、{$Think.lang.store_sns_setting_tips_1}</li>
        <li>2、{$Think.lang.store_sns_setting_tips_2}</li>
    </ul>
</div>
<form method="post" id="form_snssetting" action="{:url('Sellersns/setting')}">
    <table class="dssc-default-table">
        <thead>
            <tr>
                <th class="w100">{$Think.lang.store_sns_auto}</th>
                <th class="w400">{$Think.lang.store_sns_name}{$Think.lang.store_sns_cotent}</th>
                <th>{$Think.lang.system_default_dynamic}</th>
            </tr>
        </thead>
        <tbody>
            <tr class="bd-line">
                <td><input type="checkbox" name="new" {if !isset($storesnsset_info) || $storesnsset_info['storesnsset_new'] == 1}checked="checked"{/if} value="1" /></td>
                <td class="tl">
                    <strong>{$Think.lang.store_sns_new_selease}</strong>
                    <textarea dstype="charcount" class="textarea w400" name="new_title" rows="2" id="new_title">{$storesnsset_info.storesnsset_newtitle}</textarea>
                    <div id="charcount_new_title" class="tr w400"></div></td>
                <td><p>{$Think.lang.ds_store_auto_share_new1}</p>
                    <p>{$Think.lang.ds_store_auto_share_new2}</p>
                    <p>{$Think.lang.ds_store_auto_share_new3}</p>
                    <p>{$Think.lang.ds_store_auto_share_new4}</p>
                    <p>{$Think.lang.ds_store_auto_share_new5}</p></td>
            </tr>

            <tr class="bd-line">
                <td><input type="checkbox" name="xianshi" {if !isset($storesnsset_info) || $storesnsset_info['storesnsset_xianshi'] == 1}checked="checked"{/if} value="1" /></td>
                <td class="tl"><strong>{$Think.lang.store_sns_xianshi}</strong><textarea dstype="charcount" class="w400" name="xianshi_title" rows="2" id="xianshi_title">{$storesnsset_info.storesnsset_xianshititle}</textarea>
                    <div id="charcount_xianshi_title" class="tr w400"></div></td>
                <td><p>{$Think.lang.ds_store_auto_share_xianshi1}</p>
                    <p>{$Think.lang.ds_store_auto_share_xianshi2}</p>
                    <p>{$Think.lang.ds_store_auto_share_xianshi3}</p>
                    <p>{$Think.lang.ds_store_auto_share_xianshi4}</p>
                    <p>{$Think.lang.ds_store_auto_share_xianshi5}</p></td>
            </tr>
            <tr class="bd-line">
                <td><input type="checkbox" name="mansong" {if !isset($storesnsset_info) || $storesnsset_info['storesnsset_mansong'] == 1}checked="checked"{/if} value="1" /></td>
                <td class="tl"><strong>{$Think.lang.store_sns_mansong}</strong><textarea dstype="charcount" class="w400" name="mansong_title" rows="2" id="mansong_title">{$storesnsset_info.storesnsset_mansongtitle}</textarea>
                    <div id="charcount_mansong_title" class="tr w400"></div></td>
                <td><p>{$Think.lang.ds_store_auto_share_mansong1}</p>
                    <p>{$Think.lang.ds_store_auto_share_mansong2}</p>
                    <p>{$Think.lang.ds_store_auto_share_mansong3}</p>
                    <p>{$Think.lang.ds_store_auto_share_mansong4}</p>
                    <p>{$Think.lang.ds_store_auto_share_mansong5}</p></td>
            </tr>
            <tr class="bd-line">
                <td><input type="checkbox" name="bundling" {if !isset($storesnsset_info) || $storesnsset_info['storesnsset_bundling'] == 1}checked="checked"{/if} value="1" /></td>
                <td class="tl"><strong>{$Think.lang.store_sns_bundling}</strong><textarea dstype="charcount" class="w400" name="bundling_title" rows="2" id="bundling_title">{$storesnsset_info.storesnsset_bundlingtitle}</textarea>
                    <div id="charcount_bundling_title" class="tr w400"></div></td>
                <td><p>{$Think.lang.ds_store_auto_share_bundling1}</p>
                    <p>{$Think.lang.ds_store_auto_share_bundling2}</p>
                    <p>{$Think.lang.ds_store_auto_share_bundling3}</p>
                    <p>{$Think.lang.ds_store_auto_share_bundling4}</p>
                    <p>{$Think.lang.ds_store_auto_share_bundling5}</p></td>
            </tr>
            <tr class="bd-line">
                <td><input type="checkbox" name="groupbuy" {if !isset($storesnsset_info) || $storesnsset_info['storesnsset_groupbuy'] == 1}checked="checked"{/if} value="1" /></td>
                <td class="tl"><strong>{$Think.lang.store_sns_gronpbuy}</strong><textarea dstype="charcount" class="w400" name="groupbuy_title" rows="2" id="groupbuy_title">{$storesnsset_info.storesnsset_bundlingtitle}</textarea>
                    <div id="charcount_groupbuy_title" class="tr w400"></div></td>
                <td><p>{$Think.lang.ds_store_auto_share_groupbuy1}</p>
                    <p>{$Think.lang.ds_store_auto_share_groupbuy2}</p>
                    <p>{$Think.lang.ds_store_auto_share_groupbuy3}</p>
                    <p>{$Think.lang.ds_store_auto_share_groupbuy4}</p>
                    <p>{$Think.lang.ds_store_auto_share_groupbuy5}</p></td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <td colspan="20" class="bottom"><input type="submit" value="{$Think.lang.ds_common_button_save}" class="submit mt10 mb5" style="display: inline-block;"></td>
            </tr>
        </tfoot>
    </table>
</form>




<script type="text/javascript" src="{$Think.PLUGINS_SITE_ROOT}/jquery.charCount.js"></script> 
<script type="text/javascript">
    $(function () {
        $('#form_snssetting').validate({
            errorLabelContainer: $('#warning'),
            invalidHandler: function (form, validator) {
                $('#warning').show();
            },
            submitHandler: function (form) {
                ds_ajaxpost('form_snssetting');
            },
            rules: {
                new_title: {
                    maxlength: 140
                },
                coupon_title: {
                    maxlength: 140
                },
                xianshi_title: {
                    maxlength: 140
                },
                mansong_title: {
                    maxlength: 140
                },
                bundling_title: {
                    maxlength: 140
                },
                groupbuy_title: {
                    maxlength: 140
                }
            },
            messages: {
                new_title: {
                    maxlength: '{$Think.lang.store_sns_content_less_than}'
                },
                coupon_title: {
                    maxlength: '{$Think.lang.store_sns_content_less_than}'
                },
                voucher_title: {
                    maxlength: '{$Think.lang.store_sns_content_less_than}'
                },
                mansong_title: {
                    maxlength: '{$Think.lang.store_sns_content_less_than}'
                },
                bundling_title: {
                    maxlength: '{$Think.lang.store_sns_content_less_than}'
                },
                groupbuy_title: {
                    maxlength: '{$Think.lang.store_sns_content_less_than}'
                }
            }
        });

        //评论字符个数动态计算
        $('*[dstype="charcount"]').each(function () {
            $(this).charCount({
                allowed: 140,
                warning: 10,
                counterContainerID: 'charcount_' + $(this).attr('id'),
                firstCounterText: '{$Think.lang.sns_charcount_tip1}',
                endCounterText: '{$Think.lang.sns_charcount_tip2}',
                errorCounterText: '{$Think.lang.sns_charcount_tip3}'
            });
        });
    });
</script>
{/block}